//
// Created by 62607 on 25-8-7.
//
// Created by 62607 on 25-8-7.
//欧拉筛法
#include <bits/stdc++.h>
using namespace std;

int flag[10001];
vector<int> primes;

int main() {
    int n;
    cin >> n;
    flag[1] = 1;
    for (int i = 2; i <= n; i++) {
        if (flag[i] == 0) {
            flag[i] = i;
            primes.push_back(i);
        }
        for (int p: primes) {
            if (p * i > n) break;
            if (flag[i] < p) break;
            flag[p * i] = p; //记下 p*i的最小质因数是p
        }
        
    }

    for (int k: primes)
        cout << k << " ";
    return 0;
}
